<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .boxContainer {
            width: 800px;
            height: 200px;
        }
        
        .box {
            width: 200px;
            height: 200px;
            float: left;
            font-size: 30px;
            line-height: 200px;
            text-align: center;
        }
        
        .box1 {
            background-color: green;
        }
        
        .box2 {
            background-color: red;
        }
        
        .box3 {
            background-color: blue;
        }
        
        .box4 {
            background-color: orange;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="boxContainer">
            <div class="box box1" v-if='boxShow1'>box1</div>
            <div class="box box2" v-show='boxShow2'>box2</div>
            <div class="box box3" v-if='boxShow3'>box3</div>
            <div class="box box4" v-show='boxShow4'>box4</div>
        </div>
        <div class="btns">
            <button @click='showBox1'>Box1</button>
            <button @click='showBox2'>Box2</button>
            <button @click='showBox3'>Box3</button>
            <button @click='showBox4'>Box4</button>
        </div>
    </div>
</body>

<script src="index.js"></script>
<script>
    new Show({
        el: '#app',
        data: {
            boxShow1: false,
            boxShow2: false,
            boxShow3: false,
            boxShow4: false
        },
        methods: {
            showBox1() {
                this.boxShow1 = !this.boxShow1;
            },
            showBox2() {
                this.boxShow2 = !this.boxShow2;
            },
            showBox3() {
                this.boxShow3 = !this.boxShow3;
            },
            showBox4() {
                this.boxShow4 = !this.boxShow4;
            }
        },
    })
</script>

</html>